package com.gupao.javavip.concurrent.service;

import com.gupao.javavip.concurrent.lock.ConfigLoader;

import java.util.List;

public class Export {
    public void export(List<Data> dataList) {
        int exportModel = ConfigLoader.getExportModelConfig();

        dataList.forEach(data -> {
            if (exportModel == 0) {
                exportModel0(data);
            } else {
                exportModel1(data);
            }
        });
    }

    private void exportModel0(Data data) {
        System.out.println("Export [" + data.getId() + "] : title=>" + data.getTitle());
    }

    private void exportModel1(Data data) {
        System.out.println("Export [" + data.getTitle() + "]");
    }
}
